package the.guanzhong.express.interfaces.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wisteria.framework.web.APIResult;
import the.guanzhong.express.service.ExpressMpService;
import the.guanzhong.express.service.dto.OrderStatusUpdateMessageDTO;

import javax.annotation.Resource;

@Api(tags = "Express")
@Slf4j
@RestController
@RequestMapping("/express/test")
public class ExpressTestController {

    @Resource
    private ExpressMpService expressMpService;

    @PostMapping("/notifyOrderStatusUpdate")
    public APIResult<Boolean> notifyOrderStatusUpdate(@RequestBody OrderStatusUpdateMessageDTO dto) {
        expressMpService.notifyOrderStatusUpdate(dto);
        return APIResult.success(true);
    }
}
